#include "TrainStopData.h"
using namespace std;

namespace mta{
	trainStopData::trainStopData(const string& rawData){
		istringstream input(rawData);
		string token;
		getline(input,token,',');
		stop_id = token;
		getline(input,token,',');//junk i dont need
		getline(input,token,',');
		stop_name = token;
		getline(input,token,',');//junk i don't need
		getline(input,token,',');
		stop_lat = atof(token.c_str());
		getline(input,token,',');
		stop_lon = atof(token.c_str());
	}

	string trainStopData::get_id()const{
		return stop_id;
	}
	string trainStopData::get_stop_name()const{
		return stop_name;
	}
	double trainStopData::get_latitude()const{
		return stop_lat;
	}
	double trainStopData::get_longitude()const{
		return stop_lon;
	}

	ostream& operator<<(ostream& os, const trainStopData& tsd){
		os << tsd.stop_id << " " << tsd.stop_name << " " << tsd.stop_lat << " " << tsd.stop_lon;
		return os;
	}
}